//
// Created by wei.yang on 2021/9/6.
//

#ifndef ANDROIDFFMPEG_SOCKET_CLIENT_H
#define ANDROIDFFMPEG_SOCKET_CLIENT_H

#include <jni.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>

#define SERVER_PORT  3333
#define MAX_DATA_SIZE  100

class SocketClient {
public:
    int sock_fd;
    int send_bytes;
    char buff[MAX_DATA_SIZE];
    struct hostent *host;
    struct sockaddr_in serv_addr;
public:
    int connectServer();

    int sendMsg(char *data);

    int receiveMsg(char *data);

    int close();

};


#endif //ANDROIDFFMPEG_SOCKET_CLIENT_H
